import { request} from '@/utils/request.util';
import type { Response, Res } from '@/types/common';
import type {GetExamForm,ExamList,SubmitAudit,ExamDetailResponse,AuditExam,OrderExamHistoryResponse,ExamHistory} from '@/types/exam'

//检查：查询检验列表
export const getExamList =  (body:GetExamForm) => request.get<ExamList> ("/order/exam/getExamList", {
  params: body
});  

export const getAuditList =  (body:GetExamForm) => request.get<ExamList> ("/order/exam/getAuditList", {
  params: body
});  

//检查：提交审核
export const submitAudit = (body:SubmitAudit) => request.post<Response<Res>>("/order/exam/submitAudit",body);


//检查详情/order/exam/?execId=42
export const getExamDetail = (execId:number) => request.get<ExamDetailResponse> ("/order/exam/getOrderExamDetail", {
  params: {
    execId
  }
});

//审核
export const auditExam = (body:AuditExam) => request.post<Response<Res>>("/order/exam/auditExam",body);


//检查：查询患者历史的检查单

export const getOrderExamHistoryList =  (body:OrderExamHistoryResponse) => request.get<ExamHistory> ("/order/exam/getOrderExamHistoryList", {
  params: body
});  
